<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="int"><br>
    <button id="btn">查询</button><br>
    <input type="text" id="out">
</body>
<script>
    var intInp = document.getElementById("int");
    var btn = document.getElementById("btn");
    var outInp = document.getElementById("out");
    // console.log(intInp,btn,outInp);

    btn.onclick = function(){

        var int = intInp.value;
        console.log(int);

        if(int){
            if(int >= 1000 && int <= 9999 && int % 1 ==0){
                if(int % 4 ==0 && int % 100 != 0){
                    // alert(int + "是普通闰年");
                    outInp.value = int + "是普通闰年";
                }else if(int % 400 == 0){
                    // alert(int + "是世纪闰年");
                    outInp.value = int + "是世纪闰年";
                }else{
                    // alert(int + "不是闰年");
                    outInp.value = int + "不是闰年";
                }
            }else{
                // alert("1000-9999")
                outInp.value = "输入1000-9999";
            }
        }else{
            // alert("输入，懂？")
            outInp.value = "输入，懂？";
        }
    }
</script>
</html>